/*****************************************************************************************
**  Author:dgz master
**  Contact：jiduxiong@dagongzao.com
**
*****************************************************************************************/

import { min } from "lodash";
import axios from 'axios'; // 确保这行存在！

//此js文件是用来自定义扩展业务代码，可以扩展一些自定义页面或者重新配置生成的代码
var checkDianduNo = false
let extension = {
  components: {
    //查询界面扩展组件
    gridHeader: "",
    gridBody: "",
    gridFooter: "",
    //新建、编辑弹出框扩展组件
    modelHeader: "",
    modelBody: "",
    modelRight: "",
    modelFooter: ""
  },
  tableAction: "", //指定某张表的权限(这里填写表名,默认不用填写)
  buttons: { view: [], box: [], detail: [] }, //扩展的按钮
  methods: {
    //发送邮件方法，包含3个接口。
    // 1：通过产品代码获取客户，一个产品代码对应的客户数量大于等于1 
    // 2：通过客户从数据库中获取对应的邮箱和预警合格率值
    // 3：对比实际合格率与预警合格率，如果需要发送邮件，则传递邮箱和内容给接口
    sendLowQualifiedRateEmail(qualified_rate, product_id, diandu_no) {
      const emailData = {
        QualifiedRate: String(qualified_rate),
        ProductId: product_id,
        DianduNo: diandu_no,
        Type: "CCD结单"
        // 可以根据需要添加更多邮件内容
      };

      // 调用你的邮件服务API
      //item.url = 'api/AmesSyncBiz/SyncProductionTask_CCD'  //后端代码中<ATkg.BizAppProject/Controllers/AmesSyncController.cs中的Route
      //axios.post('api/Email/SendEmail', emailData)
      console.log(emailData);
      axios.post('api/AmesSyncBiz/SyncPartnerName', emailData)
        .then(response => {
          //alert('低合格率警告邮件已发送！'); // 浏览器弹窗提示
          console.log('低合格率警告邮件已发送');
        })
        .catch(error => {
          // alert('发送邮件失败，请检查“预警邮箱”中是否维护对应的客户邮箱！或检查网络等原因！'); // 浏览器弹窗提示
          console.error('未发送邮件', error);
        });
    },
    //新建编辑弹出框点保存时自定义业务
    async save111() {  //暂时未用，在下面的addbefore中写了该方法 
      let result = await this.$refs.form.validate()
      if (!result) {
        return
      }

      //this.editFormFields表单数据
      //this.currentRow;正在行编辑的行数据
      //this.$refs.detail.rowData明细表数据

      //这里也可以从后台处理逻辑后再调用保存
      //await this.http.post()

      //上面这些属性自己对照看要哪个,或者看文档上的属性
      if (checkDianduNo) {
        this.$confirm('该电镀号已结单，请选择覆盖原数据或新建', this.$ts('警告'), {
          confirmButtonText: '新建',
          cancelButtonText: '覆盖',
          type: 'warning',
          center: true,
          distinguishCancelAndClose: true
        }).then((r) => {
          //逻辑处理完成后调用保存操作
          console.log(r, 'rrrr')
          console.log(checkDianduNo, 1)
        }).catch(e => {
          console.log(e, 'rrrr')
          console.log(checkDianduNo, 2)

        })

      }

      ////保存前可以增加判断提示，数据从this.editFormFields表单取

      //逻辑处理完成后调用保存操作
      //this.saveExecute()

      //也可以增加弹出框做复杂处理，最终调用下this.saveExecute()即可
      //见前端开发文档上的自定义弹出框示例
    },

    //下面这些方法可以保留也可以删除
    onInit() {  //框架初始化配置前，
      //示例：在按钮的最前面添加一个按钮
      //   this.buttons.unshift({  //也可以用push或者splice方法来修改buttons数组
      //     name: "按钮", //按钮名称
      //     icon: "el-icon-document", //按钮图标：https://element.eleme.cn/#/zh-CN/component/icon
      //     type: "primary", //按钮样式:https://element-plus.gitee.io/zh-CN/component/button.html
      //     //color:"#eee",//自定义按钮颜色
      //     onClick: function () {
      //       this.$Message.success("点击了按钮");
      //     }
      //   });

      //示例：设置修改新建、编辑弹出框字段标签的长度
      // this.boxOptions.labelWidth = 150;
      //数量字段添加onKeyPress事件，输入时自动计算总价字段的值
      let DianduNoField = this.editFormOptions.flat().find(f => f.field == 'DianduNo');
      let SizeNgQtyField = this.editFormOptions.flat().find(f => f.field == 'SizeNgQty');
      let GeometryNgQtyField = this.editFormOptions.flat().find(f => f.field == 'GeometryNgQty');
      let FormNgQtyField = this.editFormOptions.flat().find(f => f.field == 'FormNgQty');
      let GongcanQtyField = this.editFormOptions.flat().find(f => f.field == 'GongcanQty');
      let okQtyAField = this.editFormOptions.flat().find(f => f.field == 'OkQtyA');
      let okQtyBField = this.editFormOptions.flat().find(f => f.field == 'OkQtyB');
      let okQtyCField = this.editFormOptions.flat().find(f => f.field == 'OkQtyC');
      let LossQtyField = this.editFormOptions.flat().find(f => f.field == 'LossQty');
      let AppearanceNgQtyAField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgQtyA');
      let AppearanceNgQtyBField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgQtyB');
      let AppearanceNgQtyCField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgQtyC');
      let OkNoGapQtyField = this.editFormOptions.flat().find(f => f.field == 'OkNoGapQty');
      let AppearanceNgNoGapQtyField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgNoGapQty');
      let LossRateField = this.editFormOptions.flat().find(f => f.field == 'LossRate');
      let OkQtyField = this.editFormOptions.flat().find(f => f.field == 'OkQty');
      let AppearanceNgQtyField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgQty');
      let DoneQtyField = this.editFormOptions.flat().find(f => f.field == 'DoneQty');
      //动态设置ID
      DianduNoField.props = { id: 'DianduNo' }
      SizeNgQtyField.props = { id: 'SizeNgQty' }
      GeometryNgQtyField.props = { id: 'GeometryNgQty' }
      FormNgQtyField.props = { id: 'FormNgQty' }
      GongcanQtyField.props = { id: 'GongcanQty' }
      okQtyAField.props = { id: 'OkQtyA' }
      okQtyBField.props = { id: 'OkQtyB' }
      okQtyCField.props = { id: 'OkQtyC' }
      AppearanceNgQtyAField.props = { id: 'AppearanceNgQtyA' }
      AppearanceNgQtyBField.props = { id: 'AppearanceNgQtyB' }
      AppearanceNgQtyCField.props = { id: 'AppearanceNgQtyC' }
      OkNoGapQtyField.props = { id: 'OkNoGapQty' }
      AppearanceNgNoGapQtyField.props = { id: 'AppearanceNgNoGapQty' }
      LossQtyField.props = {
        controlsPosition: 'right' // 可选：调整按钮位置
      };
      LossQtyField.min = -100000000
      LossRateField.min = -100000000


      this.editFormOptions.forEach((x) => {
        x.forEach((item) => {
          //监听输入框事件，给其他字段设置值
          //选择是否分档时，将对应的文本框设置为只读或可编辑,并改变颜色
          if (item.field == 'SelectGapYN') {
            item.onChange = (value) => {
              console.log(value, 'value的值为：')
              // if (okQtyAField) {
              //设置为只读或可编辑
              okQtyAField.disabled = (value == '0');
              okQtyBField.disabled = (value == '0');
              okQtyCField.disabled = (value == '0');
              AppearanceNgQtyAField.disabled = (value == '0');
              AppearanceNgQtyBField.disabled = (value == '0');
              AppearanceNgQtyCField.disabled = (value == '0');
              OkNoGapQtyField.disabled = (value == '1');
              AppearanceNgNoGapQtyField.disabled = (value == '1');

              let OkQtyAbox = document.getElementById('OkQtyA');
              let OkQtyBbox = document.getElementById('OkQtyB');
              let OkQtyCbox = document.getElementById('OkQtyC');
              let AppearanceNgQtyAbox = document.getElementById('AppearanceNgQtyA');
              let AppearanceNgQtyBbox = document.getElementById('AppearanceNgQtyB');
              let AppearanceNgQtyCbox = document.getElementById('AppearanceNgQtyC');
              let OkNoGapQtybox = document.getElementById('OkNoGapQty');
              let AppearanceNgNoGapQtybox = document.getElementById('AppearanceNgNoGapQty');
              if (value == '1') {
                OkQtyAbox.style.backgroundColor = 'lightblue';
                OkQtyBbox.style.backgroundColor = 'lightblue';
                OkQtyCbox.style.backgroundColor = 'lightblue';
                AppearanceNgQtyAbox.style.backgroundColor = 'lightblue';
                AppearanceNgQtyBbox.style.backgroundColor = 'lightblue';
                AppearanceNgQtyCbox.style.backgroundColor = 'lightblue';
                OkNoGapQtybox.style.backgroundColor = '';
                AppearanceNgNoGapQtybox.style.backgroundColor = '';
              } else {
                OkNoGapQtybox.style.backgroundColor = 'lightblue';
                AppearanceNgNoGapQtybox.style.backgroundColor = 'lightblue';
                OkQtyAbox.style.backgroundColor = '';
                OkQtyBbox.style.backgroundColor = '';
                OkQtyCbox.style.backgroundColor = '';
                AppearanceNgQtyAbox.style.backgroundColor = '';
                AppearanceNgQtyBbox.style.backgroundColor = '';
                AppearanceNgQtyCbox.style.backgroundColor = '';
              }
              //切换是否分档后各个值置0
              this.editFormFields.SizeNgQty = 0;
              this.editFormFields.OkNoGapQty = 0;
              this.editFormFields.OkQtyA = 0;
              this.editFormFields.OkQtyB = 0;
              this.editFormFields.OkQtyC = 0;
              this.editFormFields.AppearanceNgNoGapQty = 0;
              this.editFormFields.AppearanceNgQtyA = 0;
              this.editFormFields.AppearanceNgQtyB = 0;
              this.editFormFields.AppearanceNgQtyC = 0;
              this.editFormFields.FormNgQty = 0;
              this.editFormFields.SizeNgQty = 0;
              this.editFormFields.GeometryNgQty = 0;
              this.editFormFields.GongcanQty = 0;
              this.editFormFields.GongCanRate = 0;
              this.editFormFields.LossRate = 0;
              this.editFormFields.SizeNgRate = 0;
              this.editFormFields.QualifiedRate = 0;
              this.editFormFields.AppearanceNgRate = 0;
              this.editFormFields.OkQty = 0;
              this.editFormFields.AppearanceNgQty = 0;
              this.editFormFields.DoneQty = 0;
              this.editFormFields.LossQty = 0;
              console.log('OkQtyA style:', OkQtyAbox);

            }

          }

          //判定结果
          if (item.field == 'ScrapRecord') {
            item.onChange = (row, column) => {
              this.compute();
            };
          }
        });
      });
    },
    onInited() {
      //框架初始化配置后
      //如果要配置明细表,在此方法操作
      //this.detailOptions.columns.forEach(column=>{ });
      this.initFormSelectTable();


    },
    //计算各个率的方法
    compute(data = null) {
      let item = data ?? this.editFormFields
      //计算合格品总数量
      item.OkQty =
        Number(item.OkNoGapQty || 0) +
        Number(item.OkQtyA || 0) +
        Number(item.OkQtyB || 0) +
        Number(item.OkQtyC || 0);
      //计算外观不合格品总数量
      item.AppearanceNgQty =
        Number(item.AppearanceNgNoGapQty || 0) +
        Number(item.AppearanceNgQtyA || 0) +
        Number(item.AppearanceNgQtyB || 0) +
        Number(item.AppearanceNgQtyC || 0);

      //计算结单数量
      this.editFormFields.DoneQty =
        Number(item.OkQty || 0) +
        Number(item.AppearanceNgQty || 0) +
        Number(item.SizeNgQty || 0) +
        Number(item.GongcanQty || 0);

      //计算流失数量
      item.LossQty = Number(item.IncomeQty || 0) - item.DoneQty

      //计算合格率并赋值
      let QualifiedRate = ((item.OkQty || 0) / (item.DoneQty || 0)) * 100
      item.QualifiedRate = parseFloat(QualifiedRate.toFixed(2))

      //计算外观NG率
      let AppearanceNgRate = ((item.AppearanceNgQty || 0) / (item.DoneQty || 0)) * 100
      item.AppearanceNgRate = parseFloat(AppearanceNgRate.toFixed(2))

      //计算尺寸NG率
      let SizeNgRate = ((item.SizeNgQty || 0) / (item.DoneQty || 0)) * 100
      item.SizeNgRate = parseFloat(SizeNgRate.toFixed(2))

      //计算工残率
      let GongCanRate = ((item.GongcanQty || 0) / (item.DoneQty || 0)) * 100
      item.GongCanRate = parseFloat(GongCanRate.toFixed(2))

      //计算流失率
      let LossRate = ((item.LossQty || 0) / (item.IncomeQty || 0)) * 100
      item.LossRate = parseFloat(LossRate.toFixed(2))

      //计算判定结果
      let JudgeResult = Number(item.QualifiedRate || 0) + Number(item.AppearanceNgRate || 0) + Number(item.SizeNgRate || 0) + Number(item.GongCanRate || 0)
      console.log(JudgeResult);
      if (JudgeResult > 80 && JudgeResult < 120) {
        console.log(JudgeResult);
        item.JudgeResult = '数据正常'
      } else {
        console.log('ERROR');
        item.JudgeResult = '数据异常'
      }
    },
    searchBefore(param) {
      //界面查询前,可以给param.wheres添加查询参数
      //返回false，则不会执行查询
      return true;
    },
    searchAfter(result) {
      //查询后，result返回的查询数据,可以在显示到表格前处理表格的值
      return true;
    },
    addBefore(formData) {
      //新建保存前formData为对象，包括明细表，可以给给表单设置值，自己输出看formData的值
      //计算各个值
      this.compute();
      //保存前确认是否存在该单号，选择覆盖或者新建
      if (checkDianduNo) {
        this.$confirm('该电镀号已结单，请选择覆盖原数据或新建', this.$ts('警告'), {
          confirmButtonText: '新建',
          cancelButtonText: '覆盖',
          type: 'warning',
          center: true,
          distinguishCancelAndClose: true
        }).then((r) => {
          //逻辑处理完成后调用保存操作
          this.currentAction = "Add"
          this.save()
          checkDianduNo = false;
          // return true;
        }).catch(e => {
          if (e == "cancel") {
            this.editFormFields.Id = checkDianduNo
            console.log(this.currentAction, 'this.currentAction')
            this.currentAction = "Update"
            this.save()
            // return true;
          }

        })
      } else {
        this.currentAction = "Add"
        return true;
      }

    },
    async addBeforeAsync(formData) {
      //2020.12.06增加新建前异步方法同步处理
      //功能同上，区别在于此处可以做一些异步请求处理,全：
      // var _result = await this.http.post("/api/SellOrder/getPageData", {}, true).then(result => {
      //   console.log("1、异步请求前")
      //   return result;
      // })
      // console.log("2、异步请求，同步处理结果:" + JSON.stringify(_result))

      //新建编辑弹出框点保存时自定义业务

      return true;
    },

    //电镀号下拉框选择信息
    initFormSelectTable(item) {
      this.editFormOptions.forEach((option) => {
        option.forEach((item) => {
          if (item.field == 'DianduNo') {
            //if（this.editFormFields.DianduNo.）
            //电镀号处理下拉框
            item.url = 'api/AmesSyncBiz/SyncProductionTask_CCD'  //后端代码中<ATkg.BizAppProject/Controllers/AmesSyncController.cs中的Route
            //item.url = 'api/AmesSyncBiz/SyncMaterialInventory'  //后端代码中<ATkg.BizAppProject/Controllers/AmesSyncController.cs中的Route
            item.columns = [
              { field: 'DianduNo', title: '电镀号', type: 'string', width: 140, hidden: false },
              { field: 'ProductId', title: '产品代码', type: 'string', width: 130, hidden: false },
              { field: 'Spec', title: '产品规格', type: 'string', width: 110, hidden: false },
              { field: 'Grade', title: '产品性能', type: 'string', width: 110, hidden: false },
              { field: 'IncomeQty', title: '来料总数', type: 'int', width: 110, hidden: false },
              { field: 'IncomeWeight', title: '来料重量', type: 'string', width: 110, hidden: false },
            ]
            item.onSelect = (rows) => {
              //给表单字段赋值
              this.editFormFields.DianduNo = rows[0].DianduNo
              this.editFormFields.ProductId = rows[0].ProductId
              this.editFormFields.Spec = rows[0].Spec
              this.editFormFields.Grade = rows[0].Grade
              this.editFormFields.IncomeQty = rows[0].IncomeQty
              this.editFormFields.IncomeWeight = rows[0].IncomeWeight
              //通过接口查询数据库中是否存在该电镀号
              let url = "api/Ccd_Report/CheckDianduNo"
              this.http.get(url, { DianduNo: rows[0].DianduNo }, true).then(r => {
                console.log(r, 'rr')
                checkDianduNo = r
              })
            }
            item.loadBefore = (param, callback) => {
              param.value = this.editFormFields.DianduNo;
              callback(true);
            }
            item.loadAfter = (rows, callback, result) => {
              callback(true);
            }
            //监听输入框变动与回车事件
            item.onKeyPress = (val, $event) => {
              // console.log(val);
              // if ($event.keyCode == 13) {
              //   console.log('按了回车');
              // }

            }
            //设置弹出框高度(默认200)
            item.height = 500;
            //设置弹出框宽度(默认500)
            item.width = 700;
            // item.textInline = false; //设置表格超出自动换行显示
            //设置表格是否单选
            item.single = true;
            //隐藏分页
            item.paginationHide = true;
          }
        })
      })
    },
    updateBefore(formData) {
      //编辑保存前formData为对象，包括明细表、删除行的Id
      //计算各个值
      console.log(formData, 'formData')

      this.compute(formData.mainData);
      console.log(this.editFormFields, 'editFormFields')

      console.log('更新前处理')
      //this.currentAction = "Update"
      //this.save()
      return true;
    },
    delBefore(formData) {
      //编辑保存前formData为对象，包括明细表、删除行的Id
      return true;
    },
    addAfter(formData) {
      //新建保存前formData为对象，包括明细表，可以给给表单设置值，自己输出看formData的值
      //添加后刷新字典
      // this.checkDianduNo = null
      // if (formData.QualifiedRate < 0.8){
      //   item.url = 'api/AmesSyncBiz/SyncProductionTask_CCD' 
      // }  
      // 检查该产品代码的合格率警报值是多少，然后根据当前该批次的合格率判断是否给相关人员发邮件

      console.log("测试输出")
      //正式完成后再打开注释，执行自动发邮件
      this.sendLowQualifiedRateEmail(formData.data.QualifiedRate, formData.data.ProductId, formData.data.DianduNo);

      return true;
    },

    updateAfter(formData) {

      //编辑保存前formData为对象，包括明细表、删除行的Id
      //添加后刷新字典
      // this.compute();
      // this.save();
      return true;
    },
    delAfter(formData) {
      //编辑保存前formData为对象，包括明细表、删除行的Id
      //添加后刷新字典

      return true;
    },
    rowClick({ row, column, event }) {
      //查询界面点击行事件
      // this.$refs.table.$refs.table.toggleRowSelection(row); //单击行时选中当前行;
    },
    modelOpenAfter(row) {
      //点击编辑、新建按钮弹出框后，可以在此处写逻辑，如，从后台获取数据
      //(1)判断是编辑还是新建操作： this.currentAction=="Add";
      //(2)给弹出框设置默认值
      //(3)this.editFormFields.字段="xxx";
      //如果需要给下拉框设置默认值，请遍历this.editFormOptions找到字段配置对应data属性的key值
      //看不懂就把输出看：console.log(this.editFormOptions)
      this.editFormOptions.forEach(item => {
        item.forEach(x => {
          //判断字段配置
          if (x.field == "OkQtyA" || x.field == "OkQtyB" || x.field == "OkQtyC" ||
            x.field == "AppearanceNgQtyA" || x.field == "AppearanceNgQtyB" || x.field == "AppearanceNgQtyC") {
            //设置表单配置为只读状态
            x.disabled = this.currentAction == 'Add'

          }
        })
      })
      //当前是否为新建
      let isAdd = this.currentAction == 'Add';
      //新建时设置默认值
      if (isAdd) {
        let DianduNobox = document.getElementById('DianduNo');
        let IncomeQty = document.getElementById('IncomeQty');
        let SizeNgQtybox = document.getElementById('SizeNgQty');
        let GeometryNgQtybox = document.getElementById('GeometryNgQty');
        let FormNgQtybox = document.getElementById('FormNgQty');
        let GongcanQtybox = document.getElementById('GongcanQty');
        let OkNoGapQtybox = document.getElementById('OkNoGapQty');
        let AppearanceNgNoGapQtybox = document.getElementById('AppearanceNgNoGapQty');
        let OkQtyAbox = document.getElementById('OkQtyA');
        let OkQtyBbox = document.getElementById('OkQtyB');
        let OkQtyCbox = document.getElementById('OkQtyC');
        let AppearanceNgQtyAbox = document.getElementById('AppearanceNgQtyA');
        let AppearanceNgQtyBbox = document.getElementById('AppearanceNgQtyB');
        let AppearanceNgQtyCbox = document.getElementById('AppearanceNgQtyC');
        OkNoGapQtybox.style.backgroundColor = 'lightblue';
        AppearanceNgNoGapQtybox.style.backgroundColor = 'lightblue';
        OkQtyAbox.style.backgroundColor = '';
        OkQtyBbox.style.backgroundColor = '';
        OkQtyCbox.style.backgroundColor = '';
        AppearanceNgQtyAbox.style.backgroundColor = '';
        AppearanceNgQtyBbox.style.backgroundColor = '';
        AppearanceNgQtyCbox.style.backgroundColor = '';
        GeometryNgQtybox.style.backgroundColor = 'lightblue';
        FormNgQtybox.style.backgroundColor = 'lightblue';
        // DianduNobox.style.borderColor = 'lightblue';
        // console.log(DianduNobox,'DianduNobox');
        SizeNgQtybox.style.backgroundColor = 'lightblue';
        GongcanQtybox.style.backgroundColor = 'lightblue';
        //this.OkNoGapQty.field.disabled = false;
        let OkNoGapQtyField = this.editFormOptions.flat().find(f => f.field == 'OkNoGapQty');
        let AppearanceNgNoGapQtyField = this.editFormOptions.flat().find(f => f.field == 'AppearanceNgNoGapQty');
        OkNoGapQtyField.disabled = false;
        AppearanceNgNoGapQtyField.disabled = false;


        this.editFormFields.SelectGapYN = "否";
        this.editFormFields.SizeNgQty = 0;
        this.editFormFields.OkNoGapQty = 0;
        this.editFormFields.OkQtyA = 0;
        this.editFormFields.OkQtyB = 0;
        this.editFormFields.OkQtyC = 0;
        this.editFormFields.AppearanceNgNoGapQty = 0;
        this.editFormFields.AppearanceNgQtyA = 0;
        this.editFormFields.AppearanceNgQtyB = 0;
        this.editFormFields.AppearanceNgQtyC = 0;
        this.editFormFields.FormNgQty = 0;
        this.editFormFields.SizeNgQty = 0;
        this.editFormFields.GeometryNgQty = 0;
        this.editFormFields.GongcanQty = 0;
        this.editFormFields.GongCanRate = 0;
        this.editFormFields.LossRate = 0;
        this.editFormFields.SizeNgRate = 0;
        this.editFormFields.QualifiedRate = 0;
        this.editFormFields.AppearanceNgRate = 0;
        this.editFormFields.DoneQty = 0;
        this.editFormFields.OkQty = 0;
        this.editFormFields.AppearanceNgQty = 0;
        this.editFormFields.LossQty = 0;

        //如果是给下拉框设置值，值必须是字符串(自定义sql除外)
        //注意，如果表单有数据源，并且不是自定义sql,默认值都应该是字符串，比如上面的"0"

        //也可以设置数据源的第一个选项为默认值
        // this.editFormOptions.forEach(item => {
        //     item.forEach(x => {
        //             if (x.field == "字段") {
        //                //设置表单下拉框的值为第一个选项
        //                this.editFormFields.字段=x.data[0].key
        //             }
        //         })
        // })

      } else {
        let IncomeQty = this.editFormOptions.flat().find(f => f.field == 'IncomeQty');
        IncomeQty.disabled = false;
      }

    }

  }
};

export default extension;
